.class public Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;
.super Landroidx/appcompat/widget/AppCompatImageView;
.source "CropRatioSelectableButton.java"


# instance fields
.field private a:Z

.field private b:Landroid/graphics/drawable/Drawable;

.field private c:Landroid/graphics/drawable/Drawable;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    .line 1
    invoke-direct {p0, p1, v0}, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    const/4 v0, 0x0

    .line 2
    invoke-direct {p0, p1, p2, v0}, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    .line 3
    invoke-direct {p0, p1, p2, p3}, Landroidx/appcompat/widget/AppCompatImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 4
    invoke-direct {p0, p1, p2}, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 5
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->b:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V

    return-void
.end method

.method private a(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
    .locals 0
    .param p2    # I
        .annotation build Landroidx/annotation/DrawableRes;
        .end annotation
    .end param

    .line 10
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object p1

    return-object p1
.end method

.method private a(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    if-nez p2, :cond_0

    .line 1
    sget p2, Les/w4;->durec_crop_ratio_free_normal:I

    invoke-direct {p0, p1, p2}, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object p2

    iput-object p2, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->b:Landroid/graphics/drawable/Drawable;

    .line 2
    sget p2, Les/w4;->durec_crop_ratio_free_selected:I

    invoke-direct {p0, p1, p2}, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object p1

    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->c:Landroid/graphics/drawable/Drawable;

    return-void

    .line 3
    :cond_0
    sget-object v0, Les/b5;->CropRatioSelectableButton:[I

    invoke-virtual {p1, p2, v0}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object p1

    .line 4
    sget p2, Les/b5;->CropRatioSelectableButton_bg_normal:I

    invoke-virtual {p1, p2}, Landroid/content/res/TypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object p2

    iput-object p2, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->b:Landroid/graphics/drawable/Drawable;

    .line 5
    sget p2, Les/b5;->CropRatioSelectableButton_bg_selected:I

    invoke-virtual {p1, p2}, Landroid/content/res/TypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object p2

    iput-object p2, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->c:Landroid/graphics/drawable/Drawable;

    .line 6
    invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 1
    .annotation build Landroidx/annotation/UiThread;
    .end annotation

    .line 7
    iget-boolean v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a:Z

    if-eqz v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x1

    .line 8
    iput-boolean v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a:Z

    .line 9
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->c:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, v0}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V

    return-void
.end method

.method public b()V
    .locals 1

    .line 1
    iget-boolean v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a:Z

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->a:Z

    .line 3
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/crop/CropRatioSelectableButton;->b:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, v0}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V

    return-void
.end method
